import java.util.Scanner;
   public class test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
     fun3(n);
    }

    public static void fun3(int n) {
        if(n>9)
            fun3(n/10);
        System.out.printf("%d",n%10);
    }
       /*public static int fun(int n) {
        int sum=0;
      while (n > 0) {
          sum=sum*10+n%10;
          n/=10;
      }
      return sum;
    }*/
       /*public static int fun2(int n) {
           if (n == 1){
               return 1;
           }
           else {
               return fun2(n/10)+n%10;
           }
    }*/
}
